package com.pashanhoo.designpatterns.singleton;

/**懒汉式(线程安全，同步方法)[不推荐用]
 * @author 胡庆安
 * @version V1.0
 * @Package designpatterns.singleton
 * @date 2020/10/27 16:46
 * @Copyright © 2010-2020 爬山虎科技（扬州）股份有限公司
 */
public class LazySyc {
    private static LazySyc singleton;

    private LazySyc() {}

    public static synchronized LazySyc getInstance() {
        if (singleton == null) {
            singleton = new LazySyc();
        }
        return singleton;
    }
}
